<template>
    <div id="app" draggable data-layout="row">
        <!-- 操作菜单栏 -->
        <div :list="list" class="menu">
            <div @dragstart.stop="handleStart(item)" @dragend.stop="handleEnd($event, item)" draggable class="demo-btn"
                v-for="(item, index) in list" :key="index">{{ item.name }}</div>
        </div>
        <!-- 内容编辑栏 -->
        <div class="container-title" data-layout="col-between">
            <Layout :layout.sync="layout"></Layout>
        </div>
    </div>
</template>
<script>
import template from "./utils/template"
import { frame } from "./layout"
export default {
    data() {
        return {
            layout: frame,
            list: [
                { name: "容器", type: "container" },
                { name: "折线图", slot: "ZXT", type: "echarts" },
            ]
        }
    },
    mounted() {

    },
    methods: {
        handleEnd(event) {
            console.log(event, "end")
        },
        handleStart(params) {
            template.setOperate(params)
        }
    }
}
</script>

<style lang="scss">
@import "~@/model.scss";
@import "~@/style/box.scss";

.demo-btn {
    margin: 20px;
    height: 100px;
    background: #409EFF;
    // border: 1px solid #409EFF;
    border-radius: 5px;
    line-height: 100px;
    cursor: pointer;
    color: #fff;
    transform: all 1s;

    &:hover {
        background: #fff;
        color: #409EFF;
        box-shadow: 0px 0px 2px #409EFF;
    }
}

#app {
    width: 100%;
    height: 100vh;
    padding: 0px;
    margin: 0px;
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
}

body {
    margin: 0px;
}

.menu {
    width: 300px;
    flex: 0 0 300px;
    border-right: 1px solid #ccc;
}

.frame-header {
    height: 100px;
}

.frame-main {}

.absolute-demo {
    position: absolute;
    width: 200px;
    height: 30px;
    background: yellow;
    right: -100px;
}

// @layer base, demo;

// @layer demo {
//   .container-title {
//     color: rebeccapurple ;
//   }
// }

// @layer base {
//   #app .container-title {
//     color: green ;
//     border: 5px solid green;
//     font-size: 1.5em;
//     padding: .5em;
//   }
// }


.container-title {
    // background:var(--text-color,black)
}

.container-title-scanning-1 {
    // display:flex;
    padding: 20px;
    background: url("~@/assets/logo.png");
    @include VFX-dynamic-fill(rgb(62, 145, 240, .8), 10s);
}

body {
    padding:
        env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px);
}

.demo {
    width: 800px;
}
</style>
